<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 6.1.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"chenmenghui.gitee.io","root":"/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":true,"scrollpercent":true},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":false,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="php如何解决网站大流量与高并发的问题 重点 高并发架构相关概念 高并发解决方案案例    高并发的问题,需要关心的点QPS:每秒钟请求或查询的数量,在互联网领域,指每秒响应的请求数(http请求) 吞吐量:单位时间内处理的请求数量(通常由qps和并发数决定) PV:综合浏览量(page view),即页面浏览量或者点击量,一个访客在24小时内访问页面的数量.同一个人浏览网站同一页面,只记做以此P">
<meta property="og:type" content="article">
<meta property="og:title" content="高并发和大流量解决方案考点">
<meta property="og:url" content="https://chenmenghui.gitee.io/posts/12374.html">
<meta property="og:site_name" content="陈孟辉的学习笔记">
<meta property="og:description" content="php如何解决网站大流量与高并发的问题 重点 高并发架构相关概念 高并发解决方案案例    高并发的问题,需要关心的点QPS:每秒钟请求或查询的数量,在互联网领域,指每秒响应的请求数(http请求) 吞吐量:单位时间内处理的请求数量(通常由qps和并发数决定) PV:综合浏览量(page view),即页面浏览量或者点击量,一个访客在24小时内访问页面的数量.同一个人浏览网站同一页面,只记做以此P">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2019-04-29T16:00:00.000Z">
<meta property="article:modified_time" content="2022-04-15T05:54:45.016Z">
<meta property="article:author" content="陈孟辉">
<meta property="article:tag" content="PHP基础知识">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://chenmenghui.gitee.io/posts/12374.html">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>高并发和大流量解决方案考点 | 陈孟辉的学习笔记</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<link rel="alternate" href="/rss2.xml" title="陈孟辉的学习笔记" type="application/rss+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">陈孟辉的学习笔记</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">加油吧骚年</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-rss">

    <a href="/rss2.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://chenmenghui.gitee.io/posts/12374.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="陈孟辉">
      <meta itemprop="description" content="日积月藏，不做咸鱼。这里是陈孟辉的个人学习笔记，现就职于北京瑞友科技，负责维护企业ERP系统。">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="陈孟辉的学习笔记">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          高并发和大流量解决方案考点
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-04-30 00:00:00" itemprop="dateCreated datePublished" datetime="2019-04-30T00:00:00+08:00">2019-04-30</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2022-04-15 13:54:45" itemprop="dateModified" datetime="2022-04-15T13:54:45+08:00">2022-04-15</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/PHP/" itemprop="url" rel="index"><span itemprop="name">PHP</span></a>
                </span>
                  ，
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/PHP/PHP%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/" itemprop="url" rel="index"><span itemprop="name">PHP基础知识</span></a>
                </span>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/posts/12374.html#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/posts/12374.html" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>2.8k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>3 分钟</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h3 id="php如何解决网站大流量与高并发的问题"><a href="#php如何解决网站大流量与高并发的问题" class="headerlink" title="php如何解决网站大流量与高并发的问题"></a>php如何解决网站大流量与高并发的问题</h3><ul>
<li>重点<ul>
<li>高并发架构相关概念</li>
<li>高并发解决方案案例</li>
</ul>
</li>
</ul>
<h3 id="高并发的问题-需要关心的点"><a href="#高并发的问题-需要关心的点" class="headerlink" title="高并发的问题,需要关心的点"></a>高并发的问题,需要关心的点</h3><p>QPS:每秒钟请求或查询的数量,在互联网领域,指每秒响应的请求数(http请求)</p>
<p>吞吐量:单位时间内处理的请求数量(通常由qps和并发数决定)</p>
<p>PV:综合浏览量(page view),即页面浏览量或者点击量,一个访客在24小时内访问页面的数量.同一个人浏览网站同一页面,只记做以此PV</p>
<p>UV:独立访客(unique vistor),一定时间范围内相同访客多次访问网站,只计算为一个独立访客</p>
<p>带宽:计算带宽需要关注两个指标,峰值流量和页面的平均大小</p>
<p>日网站带宽 &#x3D; PV &#x2F; 统计时间(换算到秒) * 平均页面大小 (单位kb) * 8</p>
<p>压力测试<br>    - 测试能承受的最大的并发数<br>    - 测试最大承受的qbps值</p>
<h3 id="测试工具"><a href="#测试工具" class="headerlink" title="测试工具"></a>测试工具</h3><p>常用测试工具 ab(apache benchmark)<br>    - 创建多个并发访问线程,模拟多个访问者同时对某一个url地址进行访问.</p>
<p>ab的使用<br>    - 模拟并发请求100次,总共请求5000次<br>        - ab -c 100 -n 5000 <a target="_blank" rel="noopener" href="http://xxx/">http://xxx</a><br>    - 注意事项<br>        - 测试机器与被测试机器分开<br>        - 不要对线上服务做压力测试<br>        - 观察测试工具ab所在的机器,以及被测试的前端机的cpu,内存,网络等都不超过最高限度的75%</p>
<h3 id="针对优化"><a href="#针对优化" class="headerlink" title="针对优化"></a>针对优化</h3><p>QBS达到极限<br>    - 50<br>        - 小网站,无需优化<br>    - 100<br>        - 假设关系型数据库每次请求在0.01秒内完成<br>        - 假设一个页面只有一个sql查询,那么100qbs意味着1秒钟完成100次请求,但是此时我们并不能保证数据库查询能够完成100次<br>        - 方案<br>            - 数据库缓存层<br>            - 负载均衡<br>    - 800<br>        - 假设使用的是百兆带宽,意味着网站出口的实际带宽是8m左右<br>        - 假设每个页面只有10k,在这个并发条件下,百兆带宽已经吃完<br>        - 方案<br>            - cdn加速<br>            - 负载均衡<br>    - 1000<br>        - 假设使用memcache缓存数据库查询数据,每个页面对memcache的请求远大于直接对db的请求<br>        - memcache的悲观并发数在2w左右,但有可能在之前内网带宽已经吃光,表现出不稳定<br>        - 方案<br>    - 2000<br>        - 这个级别下,文件系统访问锁都成了灾难<br>        - 方案<br>            - 业务分离<br>            - 分布式存储</p>
<ul>
<li>优化    <ul>
<li>流量优化<ul>
<li>防盗链处理</li>
</ul>
</li>
<li>前端优化<ul>
<li>减少http请求</li>
<li>添加异步请求</li>
<li>启用浏览器缓存和文件压缩</li>
<li>CDN加速</li>
<li>建立独立的图片服务器</li>
</ul>
</li>
<li>服务端优化 <ul>
<li>页面静态化处理</li>
<li>并发处理</li>
<li>队列处理</li>
</ul>
</li>
<li>数据库优化<ul>
<li>数据库缓存 redis等</li>
<li>分库分表,分区操作</li>
<li>读写分离</li>
<li>负载均衡</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 id="web资源防盗链"><a href="#web资源防盗链" class="headerlink" title="web资源防盗链"></a>web资源防盗链</h4><p>盗链概念<br>    - 盗链是指在自己的页面展示一些并不在自己服务器的内容<br>    - 获得他人服务器上的资源地址,绕过别人的资源展示页面,直接在自己的页面上向用户提供此内容<br>    - 小站盗用大站的图片,音乐,视频,软件等<br>    - 通过盗链可以减轻自己服务器的负担,因为真实的空间流量均是来自别人的服务器</p>
<p>防盗链<br>    - 防止他人通过技术手段绕过本站的资源展示页面,盗用本站的资源,让绕开本站资源展示页面的资源链接失效<br>    - 可以大大减轻服务器及带宽压力</p>
<p>防盗链工作原理<br>    - 通过referer或签名,网站可以检测目标网页访问的来源网页,如果是资源文件,则可以追踪到显示它的网页地址<br>    - 一旦检测到来源不是本站即进行阻止或返回指定的页面</p>
<p>防盗链手段<a target="_blank" rel="noopener" href="https://blog.csdn.net/zhanghao143lina/article/details/77504046">Nginx防盗链的3种方法
</a><br>    - referer (伪造refer)<br>        - nginx模块ngx_http_referer_moudle用于阻挡来源非法的域名请求<br>            - valid_referers none|blocked|server_names|string …<br>                - none: referer 来源头部为空的情况<br>                - blocked: referer来源不为空,但是其值被代理或者防火墙删除了,这些值都不以http或https开头<br>                - server_name:<br>    - 使用第三方模块HttpAccessKeyMoudle实现Nginx防盗链</p>
<h4 id="减少http请求"><a href="#减少http请求" class="headerlink" title="减少http请求"></a>减少http请求</h4><ul>
<li><p>性能黄建法则</p>
<ul>
<li>只有10%-20%的最终用户响应时间花在接受请求的html文档上,剩下的80%-90%时间花在html文档所应用的所有组件(图片,script,css等)进行的http请求上</li>
<li>改善相应时间的最简单的方式就是减少组件数量</li>
</ul>
</li>
<li><p>http链接产生的开销</p>
<ol>
<li>域名解析</li>
<li>tcp连接</li>
<li>发送请求</li>
<li>等待</li>
<li>下载资源</li>
<li>解析时间</li>
</ol>
</li>
<li><p>减少http请求的方式</p>
<ul>
<li>图片<ul>
<li>图片地图</li>
<li>css sprites(雪碧图)</li>
<li>图片使用base64编码减少页面请求数</li>
</ul>
</li>
<li>css和js<ul>
<li>使用外部的css和js</li>
<li>多个js或css合并</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 id="启用浏览器缓存"><a href="#启用浏览器缓存" class="headerlink" title="启用浏览器缓存"></a>启用浏览器缓存</h4><ul>
<li>缓存分类<ul>
<li>200 from cache:本地缓存,直接从本地缓存中获取响应,最快速最省流量,因为并没有向服务器发送请求</li>
<li>304 not modified:协商缓存,浏览器在本地没有命中的情况下请求头中发送一定的校验数据到服务端,如果服务端数据没有改变,浏览器从本地缓存相应,返回304.快速,发送的数据很少,只返回一些基本的响应头信息,数据量很小,不发送实际响应体</li>
<li>200 ok:以上两种缓存全部失败,服务器返回完整相应.没有用到缓存,相对缓慢</li>
</ul>
</li>
</ul>
<h5 id="本地缓存"><a href="#本地缓存" class="headerlink" title="本地缓存"></a>本地缓存</h5><p>相关Header</p>
<pre><code>- pragma:http1.0时代遗留的产物,该字段被设置为no-cache时,会告知浏览器禁用本地缓存,即每次都向服务器发送请求
- expires:http1.0时代用来启用本地缓存的字段,其值形如thu,31 dec 2019 11:22:33 GMT的格林威治时间.告诉浏览器缓存实现的时刻,如果没有到该时刻,标明缓存有效,无须发送请求.浏览器与服务器的时间无法保持一致,会影响缓存结果
- cache-control:http1.1针对expires时间不一致的解决方案,它告诉浏览器缓存过期的时间间隔而不是时刻
</code></pre>
<ul>
<li>cache-control<ul>
<li>no-store:禁止浏览器缓存相应</li>
<li>no-cache:不允许直接使用本地缓存,先发起请求和服务器协商</li>
<li>max-age&#x3D;delta-seconds:告知浏览器该响应本地缓存有效的最长期限,单位秒</li>
</ul>
</li>
</ul>
<p>协商缓存:当浏览器没有命中本地缓存,如本地缓存过期或者响应中声明不允许直接使用本地缓存,那么浏览器肯定会发起服务端请求.服务端会验证数据是否修改,如果没有通知则浏览器使用本地缓存</p>
<ul>
<li>协商缓存<ul>
<li>last-modified:通知浏览器资源最后修改时间</li>
<li>if-modified-since:得到资源的最后修改时间后,会将这个信息通过if-modified-since提交到服务器做检查,如果没有修改,返回304状态码</li>
</ul>
</li>
</ul>
<p>Etag:http1.1推出,文件的指纹标识符,如果文件内容修改,指纹会改变</p>
<p>if-none-match:本地缓存失效,会携带此值请求服务端,服务端判断该资源是否改变,如果没有改变,直接使用本地缓存,返回304</p>
<p>适合缓存的内容:<br>    - 不变的图片,如logo,图标等<br>    - js,css静态文件<br>    - 可下载的内容,媒体文件</p>
<p>建议使用协商缓存<br>    - html文件<br>    - 经常替换的图片<br>    - 经常修改的css,js</p>
<p>其中,js css文件的加载可以加入文件签名来拒绝缓存,想index.js?签名</p>
<p>不建议缓存的内容<br>    - 用户隐私<br>    - 经常变化api数据接口</p>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/PHP%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/" rel="tag"># PHP基础知识</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/posts/16665.html" rel="prev" title="C++基本语法">
      <i class="fa fa-chevron-left"></i> C++基本语法
    </a></div>
      <div class="post-nav-item">
    <a href="/posts/58742.html" rel="next" title="并行与并发的区别">
      并行与并发的区别 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#php%E5%A6%82%E4%BD%95%E8%A7%A3%E5%86%B3%E7%BD%91%E7%AB%99%E5%A4%A7%E6%B5%81%E9%87%8F%E4%B8%8E%E9%AB%98%E5%B9%B6%E5%8F%91%E7%9A%84%E9%97%AE%E9%A2%98"><span class="nav-number">1.</span> <span class="nav-text">php如何解决网站大流量与高并发的问题</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%AB%98%E5%B9%B6%E5%8F%91%E7%9A%84%E9%97%AE%E9%A2%98-%E9%9C%80%E8%A6%81%E5%85%B3%E5%BF%83%E7%9A%84%E7%82%B9"><span class="nav-number">2.</span> <span class="nav-text">高并发的问题,需要关心的点</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%B5%8B%E8%AF%95%E5%B7%A5%E5%85%B7"><span class="nav-number">3.</span> <span class="nav-text">测试工具</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%92%88%E5%AF%B9%E4%BC%98%E5%8C%96"><span class="nav-number">4.</span> <span class="nav-text">针对优化</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#web%E8%B5%84%E6%BA%90%E9%98%B2%E7%9B%97%E9%93%BE"><span class="nav-number">4.1.</span> <span class="nav-text">web资源防盗链</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%87%8F%E5%B0%91http%E8%AF%B7%E6%B1%82"><span class="nav-number">4.2.</span> <span class="nav-text">减少http请求</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%90%AF%E7%94%A8%E6%B5%8F%E8%A7%88%E5%99%A8%E7%BC%93%E5%AD%98"><span class="nav-number">4.3.</span> <span class="nav-text">启用浏览器缓存</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#%E6%9C%AC%E5%9C%B0%E7%BC%93%E5%AD%98"><span class="nav-number">4.3.1.</span> <span class="nav-text">本地缓存</span></a></li></ol></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">陈孟辉</p>
  <div class="site-description" itemprop="description">日积月藏，不做咸鱼。这里是陈孟辉的个人学习笔记，现就职于北京瑞友科技，负责维护企业ERP系统。</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">170</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">45</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">60</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title"><i class="fa fa-link fa-fw"></i>
      Links
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="http://tool.oschina.net/uploads/apidocs/jquery/regexp.html" title="http:&#x2F;&#x2F;tool.oschina.net&#x2F;uploads&#x2F;apidocs&#x2F;jquery&#x2F;regexp.html" rel="noopener" target="_blank">正则表达式</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://www.cs.usfca.edu/~galles/visualization/Algorithms.html" title="https:&#x2F;&#x2F;www.cs.usfca.edu&#x2F;~galles&#x2F;visualization&#x2F;Algorithms.html" rel="noopener" target="_blank">算法图示</a>
        </li>
    </ul>
  </div>

      </div>
        <div class="back-to-top motion-element">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2024</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">陈孟辉</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-area"></i>
    </span>
    <span title="站点总字数">204k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">3:06</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>

<script src="/js/utils.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : true,
      notify     : true,
      appId      : '9jQqXQuURk2dvsv5oVh9D0VM-gzGzoHsz',
      appKey     : 'YfjrSNHQAtj63yeNmdmrLlLw',
      placeholder: "Just go go",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : false,
      lang       : '' || 'zh-cn',
      path       : location.pathname,
      recordIP   : true,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
